package com.shop.controller;

import com.shop.service.DtsUserService;
import com.shop.util.ResponseUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @ClassName AdminStatController
 * @Author xiao宋
 * @Date 15:29  2022/10/18
 * @Version 1.0
 * @Description TODO
 */
@Slf4j
@RestController
@RequestMapping("/admin/stat")
public class AdminStatController {
    @Autowired
    DtsUserService userService;

    @GetMapping("/user")
    public Object user() {
        Map<String, Object> data =userService.getUser();
        return ResponseUtil.ok(data);
    }

    @GetMapping("/order")
    public Object order() {
        Map<String, Object> data =userService.getOrderMsg();
        return ResponseUtil.ok(data);
//        return ResponseUtil.ok();
    }
    /**
     * 统计第三张表
     * @return
     */
    @GetMapping("/goods")
    public Object goods() {
        Map<String, Object> data =userService.getGoods();
        return ResponseUtil.ok(data);
    }
}
